<?php

namespace App\Http\Models\Admin;

use Illuminate\Database\Eloquent\Model;

class ClassifyPermissions extends Model
{
    // 
    // protected $table="permission";

    public function classifyHasMany()
    {
        return $this->hasMany(get_class($this), 'parent_id');
    }
    
    public function hasManyDetails()
    {
        //关联的模型类名, 关系字段
        return $this->belongsToMany('App\Http\Models\Admin\Permission_', 'classify_has_permissions', 'classify_id', 'permission_id');
    }
}
